package com.ego.order.feign;

import com.ego.common.util.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @program: ego
 * @description: 商品远程服务
 * @author: KamTang
 * @create: 2022-12-22 21:34
 **/
@FeignClient("ego-product")
public interface ProductFeign {

    /**
     * 获取当前用户的购物项
     * @param memberId 当前登录用户id
     * @return @see
     * @see Result
     */
    @GetMapping("/cart/getItem")
    @ResponseBody
    Result getCurrentUserCartItem(@RequestParam("memberId") Long memberId);

    /**
     * 根据SkuId获取spu信息
     * @param skuId skuId
     * @return @see
     * @see Result
     */
    @GetMapping("/product/spu-info/getBySkuId/{skuId}")
    Result getSpu(@PathVariable("skuId") Long skuId);

    /**
     * 根据skuId获取sku信息
     * @param skuId skuId
     * @return sku信息
     */
    @GetMapping("/product/sku-info/get/{skuId}")
    Result getSku(@PathVariable("skuId") Long skuId);
}
